package com.oxygen.pt.mapper;


import com.oxygen.pt.pojo.entity.ChamberCheckWeekly;
import com.oxygen.pt.pojo.vo.ChamberCheckWeeklyVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ChamberCheckWeeklyMapper {

    /* 新增 */
    int insert(ChamberCheckWeekly record);

    /* 主键删除 */
    int deleteById(Long id);

    /* 主键更新（全字段）*/
    int updateById(ChamberCheckWeekly record);

    /* 主键查询 */
    ChamberCheckWeekly selectById(Long id);

    /* 分页查询：按氧舱号 + 巡检日期范围
       注意：limit/offset 需要手动传入
     */
    List<ChamberCheckWeekly> selectByCondition(@Param("chamberNo") String chamberNo,
                                               @Param("beginDate") LocalDate beginDate,
                                               @Param("endDate") LocalDate endDate,
                                               @Param("offset") long offset,
                                               @Param("limit") int limit);

    /* 条件总数，用于分页 total */
    long countByCondition(@Param("chamberNo") String chamberNo,
                          @Param("beginDate") LocalDate beginDate,
                          @Param("endDate") LocalDate endDate);

    List<ChamberCheckWeeklyVO> selectVoByCondition(@Param("chamberNo") String chamberNo,
                                                   @Param("beginDate") LocalDate beginDate,
                                                   @Param("endDate") LocalDate endDate);
}